s = "   Hello, World!   "

print(s.strip())   # 去除两端空格：Hello, World!
print(s.lstrip())  # 去除左端空格：Hello, World!   
print(s.rstrip())  # 去除右端空格：   Hello, World!

print('**中华***'.strip('*')) # 去除两端*：中华
print('abcdeba'.strip('ab'))  # 去除两端a和b：cde
print('abcdeba'.strip('ba'))  # 去除两端a和b：cde